import handleArr from './index'

let defaultState = {...handleArr.state}

let reducer = (state = defaultState,action:{type:string,val:number})=>{    
    let newState = JSON.parse(JSON.stringify(state))  // 深拷贝

    switch(action.type){
        case handleArr.sarrpush:
            handleArr.actions[handleArr.sarrpush](newState,action)
            break;
        default:
            return newState
    }

    return newState
}

export default reducer